//
//  NoticeDetailViewController.m
//  Rail
//
//  Created by hychen on 2018/3/1.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "NoticeDetailViewController.h"

@interface NoticeDetailViewController ()

@end

@implementation NoticeDetailViewController

- (void)viewDidLoad {
    
    self.url = self.model.content_url;
    
    [super viewDidLoad];
    
    [self.navigationItem addSimpleTitleView:self.model.title];
    
    NSMutableSet *newCacheSet = [[CacheTool sharedTool] objectForKey:Cache_Notice_Scan_Key];
    if (!newCacheSet) {
        newCacheSet = [NSMutableSet set];
    }
    if (self.model) {
        if (![newCacheSet containsObject:self.model.noticeid]) {
            [newCacheSet addObject:self.model.noticeid];
            [[CacheTool sharedTool] setObject:newCacheSet forKey:Cache_Notice_Scan_Key];
        }
        if (self.model.content_url) {
            self.url = self.model.content_url;
            [self loadUrlString:self.url];
        }
        else {
            //加载Web或Html
            [self.webView loadHTMLString:self.model.content?:@"" baseURL:nil];
            self.webView.scrollView.mj_header = nil;
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
